<template>
  <div class="tab_user">
    <div class="city">{{user.city?user.city.slice(0,2):''}}</div>
    <div class="" @click="lookDoctor">
      <div class="name">
        <span class="sp1">{{user.name||''}}</span>
      </div>
      <div class="mobile">
        {{user.hospitalName||''}}
      </div>
    </div>
  </div>
</template>
<script>
import { broadcast } from "@/common/util";
export default {
  name: "TabDoctor",
  props: {
    user: {
      type: Object,
      default: () => {
        return {};
      },
    },
    disabled: {
      type: Boolean,
      default: false,
    },
    hidden: {
      type: Boolean,
      default: false,
    },
    url:{
      type:String,
      default:'doctor/all/add'
    }
  },
  data() {
    return {
      showDialog: false,
    };
  },
  mounted() {},
  methods: {
    // 查看用户信息
    lookDoctor() {
      if (this.disabled) {
        return false;
      }
      let row = this.user;
      let o = window.location.origin;
      //broadcast("userDetail", row);
      //let path = `${o}/#/doctor/add?id=${row.id}&status=${3}&hidden=${this.hidden}`;
      let path = `${o}/#/${this.url}?id=${row.id}&status=${3}&hidden=${this.hidden}`
      window.open(path);
      // this.$router.push({
      //   name: "addDoctor",
      //   query: { id: row.id, status: 3 },
      // });
    },
  },
};
</script>
<style lang="scss" scoped>
.tab_user {
  display: flex;
  align-items: center;
  cursor: pointer;
  width: 100%;
  .city {
    min-width: 32px;
    height: 32px;
    background: #167fff;
    border-radius: 4px;
    font-size: 14px;
    font-family: PingFang SC-Regular, PingFang SC;
    font-weight: 400;
    color: #ffffff;
    text-align: center;
    line-height: 32px;
    margin-right: 7px;
  }
  .name {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-family: PingFang SC-Medium, PingFang SC;
    font-weight: 500;
    color: #167fff;
    .sp1 {
      flex-shrink: 0;
    }
    .tag_list {
      flex: 1;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      .tag {
        margin: 0 4px;
      }
    }
  }
  .mobile {
    font-size: 12px;
    font-family: DIN-Regular, DIN;
    font-weight: 400;
    color: #999999;
  }
}
</style>